package com.zj.common;

import java.util.ArrayList;
import java.util.List;

import com.zj.common.req.BusinessContent;
import com.zj.common.req.Code;
import com.zj.common.req.ContentControl;
import com.zj.common.req.Encrypt;
import com.zj.common.req.Identity;
import com.zj.common.req.ParamList;
import com.zj.common.req.ReturnState;
import com.zj.common.req.SubPackage;
import com.zj.common.req.Zip;
import com.zj.common.xml.XmlUtil;
import com.zj.request.*;
import com.zj.request.body.*;
import com.zj.request.body.Spmx;
import com.zj.request.head.*;
import com.zj.response.*;
import com.zj.response.body.*;
import com.zj.response.body.Jsyhxx;
import com.zj.response.head.JhSyPublicHead;
import com.zj.response.head.JhSyYhCxRespHead;
import com.zj.response.head.JhSyYhCxjfRespHead;
import com.zj.response.head.JhSyYhXyRespHead;

/**
 * @createUser daiyuan
 * @createTime 2019/2/25 15:18
 * @describe 实时请求测试
 **/
public class RealTimeTest {

    public static void main(String[] args) {
        //个人银行缴费参保查询
         gryhJf();          //个人银行缴费城乡居民查询
        //gryhJfLh();        //个人银行缴费灵活就业查询
        //gryhKk();          //个人银行缴费扣款结果确认
        // gryhJfCx();       //个人银行缴费撤销
        //grwtKkJf();        //个人委托扣款缴费协议（生效/撤销）
        //grswSsJf();        //个人税务实时缴费
        //grjfJyZtCx();      //个人缴费交易状态查询
        //lhjyRy();          //灵活就业人员缴费基数上下限及档次信息查询
        //    cxzmJf();           //城乡居民缴费金额上下限及档次信息查询
    }


    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 10:18 AM
     * @describe 个人银行缴费城乡居民查询
     **/

    public static void gryhJf() {
        JhSyYhCxjmcxRqBody open = new JhSyYhCxjmcxRqBody();
        JhSyYhcxjfTyReqHead head = new JhSyYhcxjfTyReqHead("20180707");
        open.setHead(head);

        JhSyYhCxjmcxReqBody jhSyYhCxjmcxReqBody = new JhSyYhCxjmcxReqBody("身份证", "120796433901950013", "张溪阳", "医疗保险", "2018", "001210", "980.0");
        open.setBody(jhSyYhCxjmcxReqBody);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYYHA1", "20161018000119949000");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "105");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);
        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhCxjmcxRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhCxjmcxRqBody.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYYHA2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        List<JfmxLists> jfmxlist = new ArrayList<>();
        Jfmx jfmx1 = new Jfmx("19047000", "198740011", "0100110244", "01020", "8192749875", "97109124", "20180619", "20180916", "1998742", "城市维护建设税", "0987015", "税收收入", "8624984", "城镇土地使用税", "7440.0");
        Jfmx jfmx2 = new Jfmx("19047000", "198740011", "0100110244", "01020", "8192749875", "97109124", "20180619", "20180916", "1998742", "城市维护建设税", "0987015", "税收收入", "8624984", "城镇土地使用税", "7440.0");
        jfmxlist.add(new JfmxLists(jfmx1));
        jfmxlist.add(new JfmxLists(jfmx2));

        JhSyYhCxjmcxRpBody openResp = new JhSyYhCxjmcxRpBody(
                new JhSyYhCxjfRespHead("824710424", "20180926", "20181016", "1091407"),
                new JhSyYhCxjmcxRespBody("身份证", "203756899337231107", "张溪阳", "89126021", new Jsyhxx("197240", "28110971", "南京银行", "6217770003490749"), new ReturnInfo("000", "成功"), jfmxlist));
        openResp.setName("jhSyYhCxjmcxRespBody");
        openResp.setCnName("个人银行缴费城乡居民查询响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 10:20 AM
     * @describe 个人银行缴费灵活就业查询
     **/
    public static void gryhJfLh() {
        JhSyYhLhjycxRqBody open = new JhSyYhLhjycxRqBody();
        JhSyYhLhjycxReqHead head = new JhSyYhLhjycxReqHead("20180619");
        JhSyYhLhjycxReqBody body = new JhSyYhLhjycxReqBody("身份证", "365934659956488895", "张溪阳", "医疗保险", "20180216", "20180719", "001256", "1000.0");

        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYYHB1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "105");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);

        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("00", "12");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhLhjycxRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhLhjycxRqBody.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYYHB2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        List<JfmxlistLhjy> jfmxlistLhjy = new ArrayList<>();
        JfmxLhjy jfmxLhjy1 = new JfmxLhjy("847037434", "001180124", "87034111", "0669", "10101223", "8959484345", "20180319", "20180916", "812740274", "地税", "1260471", "个人所得税", "01801702", "其他税", "1.2", "5389.0", "5990.0");
        JfmxLhjy jfmxLhjy2 = new JfmxLhjy("847037434", "001180124", "87034111", "0669", "10101223", "8959484345", "20180319", "20180916", "812740274", "地税", "1260471", "个人所得税", "01801702", "其他税", "1.2", "5389.0", "5990.0");

        jfmxlistLhjy.add(new JfmxlistLhjy(jfmxLhjy1));
        jfmxlistLhjy.add(new JfmxlistLhjy(jfmxLhjy2));


        Jsyhxx jsyhxx = new Jsyhxx("378180", "0801011", "南京银行", "6217770003490749");

        JhSyYhLhjycxRespBody jhSyYhLhjycxRespBody = new JhSyYhLhjycxRespBody("身份证", "468290198309755563", "张溪阳", "0155", jsyhxx, new ReturnInfo("000", "成功"), jfmxlistLhjy);


        JhSyYhLhjycxRpBody openResp = new JhSyYhLhjycxRpBody(new JhSyYhCxjfRespHead("402100000018", "20170929", "20181109", "9214009"), jhSyYhLhjycxRespBody);


        openResp.setName("jhSyYhLhjycxRespBody");
        openResp.setCnName("个人银行缴费灵活就业查询响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }


    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 10:49 AM
     * @describe 个人银行缴费扣款结果确认请求
     **/
    public static void gryhKk() {
        JhSyYhKkjgRqBody open = new JhSyYhKkjgRqBody();
        JhSyYhKkjgHead head = new JhSyYhKkjgHead("102100009980", "20180619", "2", "3");

        List<JfmxYhkkjg> jfmxlistYhkkjg = new ArrayList<>();
        JfmxYhkkjg jfmxYhkkjg = new JfmxYhkkjg("1", "2", "3", "4", "5");
        jfmxlistYhkkjg.add(jfmxYhkkjg);
        JhSyYhKkjgReqBody body = new JhSyYhKkjgReqBody("989702368", "23121", jfmxlistYhkkjg);
        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYYHC1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "105");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);

        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhKkjgRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhKkjgRqBody.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYYHC2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        com.zj.response.head.JhSyYhKkjgHead jhSyYhKkjgHead = new com.zj.response.head.JhSyYhKkjgHead("574", "20180724", "20180928", "12094750");
        JhSyYhKkjgRespBody jhSyYhKkjgRespBody = new JhSyYhKkjgRespBody("10028982424", "2000.0", new ReturnInfo("000", "成功"));

        JhSyYhKkjgRpBody openResp = new JhSyYhKkjgRpBody(jhSyYhKkjgHead, jhSyYhKkjgRespBody);

        openResp.setName("jhSyYhKkjgRespBody");
        openResp.setCnName("个人银行缴费扣款结果确认响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 11:35 AM
     * @describe 个人银行缴费撤销
     **/

    public static void gryhJfCx() {
        JhSyYhCxRqBody open = new JhSyYhCxRqBody();
        JhSyYhCxReqHead head = new JhSyYhCxReqHead("102100009980", "20180926");
        JhSyYhCxReqBody body = new JhSyYhCxReqBody("989702368");
        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYYHD1", "20161018000119949000");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "105");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);

        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhCxRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhCxRqBody.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYYHD2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        JhSyYhCxRpBody openResp = new JhSyYhCxRpBody(new JhSyYhCxRespHead("402100000018", "20180527"), new JhSyYhCxRespBody("200080424", new ReturnInfo("000", "成功")));

        openResp.setName("jhSyYhCxResponse");
        openResp.setCnName("个人银行缴费撤销响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));


    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/26 10:11 PM
     * @describe 个人委托扣款缴费协议（生效/撤销）
     **/
    public static void grwtKkJf() {

        JhSyYhXyRqBody open = new JhSyYhXyRqBody();
        JhSyYhXyReqHead head = new JhSyYhXyReqHead("10274024", "20180915");
        JhSyYhXyReqBody body = new JhSyYhXyReqBody("305626188957286591", "201", "210565338965832950", "张溪阳", "2874063", "00204705", "招商银行", "6217770003490749", "8240652182994");

        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYXYA1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "105");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);
        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhXyRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhXyRqBody.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYXYA2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        JhSyYhXyRespBody jhSyYhXyRespBody = new JhSyYhXyRespBody("0", "201", "234705589638622202", "张溪阳", "290370110597", "102100009980", "招商银行", "6217770003490749", "1110102027388", "测试账号", "102000010011", new ReturnInfo("000", "成功"));

        JhSyYhXyRpBody openResp = new JhSyYhXyRpBody(new JhSyYhXyRespHead("23975005", "20180618"), jhSyYhXyRespBody);

        openResp.setName("jhSyYhXyRespBody");
        openResp.setCnName("个人委托扣款缴费协议响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 11:50 AM
     * @describe 个人税务实时缴费
     **/

    public static void grswSsJf() {

        JhSySkRqBody open = new JhSySkRqBody();
        JhSySkHead head = new JhSySkHead("10111111101", "105", "20181012", "20181111");
        Jbyhxx jbyhxx = new Jbyhxx("9991", "402100000018", "农商行", "080100002451054", "北京东之丽彩壁纸销售中心");
        com.zj.request.body.Jsyhxx jsyhxx = new com.zj.request.body.Jsyhxx("9991", "402100000018", "农商行", "080100002451054");

        List<SzmxList> szmxlist = new ArrayList<>();
        Szmx szmx1 = new Szmx("201810", "201811", "58290", "税收收入", "307229070", "城市维护建设税", "0087492444858201", "城镇土地使用税", "566.0");
        Szmx szmx2 = new Szmx("201810", "201811", "58290", "税收收入", "307229070", "城市维护建设税", "0087492444858201", "城镇土地使用税", "566.0");
        szmxlist.add(new SzmxList(szmx1));
        szmxlist.add(new SzmxList(szmx2));

        Spmx spmx = new Spmx("131029111111112209", "23986502", "352229196906261016", "北京福宁乐超市", "11502040000", "北京市丰台区国家税务局", "1110105153867", jbyhxx, jsyhxx, "820.0", "20181122", szmxlist);

        JhSySkReqBody body = new JhSySkReqBody(spmx);

        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYSKA1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "105");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);
        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSySkRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSySkRqBody.class);
        System.out.println(open1);
        tiripPackage.getIdentity().setServiceId("SYSKA1");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        JhSySpmxResp jhSySpmxResp = new JhSySpmxResp("131029111111112209", "20701240", "820.0", "20181122", new ReturnInfo("000", "成功"));
        JhSySkRpBody openResp = new JhSySkRpBody(new com.zj.response.head.JhSySkHead("10111111101", "105", "20181012", "20181010"), jhSySpmxResp);

        openResp.setName("jhSyYhXyResponse");
        openResp.setCnName("个人税务实扣缴费结果回执响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/26 11:09 PM
     * @describe 个人缴费交易状态查询
     **/
    public static void grjfJyZtCx() {

        JhSySpztcxRqItem open = new JhSySpztcxRqItem();
        JhSyJyztCxHead head = new JhSyJyztCxHead("105", "20181012");
        JhSySpztcxReqItem body = new JhSySpztcxReqItem("SYZTC1", "131029111111112205", "11502040000", "20181012", "23423424", "23422545");

        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYZTC1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "102");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);
        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSySpztcxRqItem open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSySpztcxRqItem.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYZTC1");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("000", "成功"));

        JhSySpztcxRespItem jhSySpztcxRespItem = new JhSySpztcxRespItem("SYZTC1", "406131111111111149", "11502040000", "20181012", "23423424", "23422545", new ReturnInfo("000", "成功"));
        JhSySpztcxRpItem openResp = new JhSySpztcxRpItem(new com.zj.response.head.JhSyJyztCxHead("105", "20181012"), jhSySpztcxRespItem);

        openResp.setName("jhSySpztcxRespItem");
        openResp.setCnName("个人缴费税票状态查询响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 9:52 AM
     * @describe 灵活就业人员缴费基数上下限及档次信息查询
     **/
    public static void lhjyRy() {

        JhSyYhLhjySxxAndDcRqBody open = new JhSyYhLhjySxxAndDcRqBody();
        JhSyYhcxjfTyReqHead head = new JhSyYhcxjfTyReqHead("20181226");
        JhSyYhLhjySxxAndDcReqBody body = new JhSyYhLhjySxxAndDcReqBody("111000000000", "10220", "201812");

        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYYHE1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "102");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);
        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("C01", "查询成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhLhjySxxAndDcRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhLhjySxxAndDcRqBody.class);
        System.out.println(open1);

        tiripPackage.getIdentity().setServiceId("SYYHE2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("C01", "查询成功"));
        List<LhjycxSxxDcJfmxList> lhjycxSxxDcJfmxList = new ArrayList<>();

        LhjycxSxxDcJfmxList lhjycxSxxDcJfmxList1 = new LhjycxSxxDcJfmxList("110011001100", "10032", "100902000", "1003210900909099", "100.0", "1000.0", "测试档次", "300.0", "20180101", "20181231");
        LhjycxSxxDcJfmxList lhjycxSxxDcJfmxList2 = new LhjycxSxxDcJfmxList("110011001100", "10032", "100902000", "1003210900909099", "100.0", "1000.0", "测试档次", "300.0", "20180101", "20181231");

        lhjycxSxxDcJfmxList.add(lhjycxSxxDcJfmxList1);
        lhjycxSxxDcJfmxList.add(lhjycxSxxDcJfmxList2);
        JhSyYhLhjycxSxxAndDcResBody jhSyYhLhjycxSxxAndDcResBody = new JhSyYhLhjycxSxxAndDcResBody(new ReturnInfo("000", "成功"), lhjycxSxxDcJfmxList);
        JhSyYhLhjySxxAndDcRpBody openResp = new JhSyYhLhjySxxAndDcRpBody(new JhSyPublicHead("102100000018", "20181226"), jhSyYhLhjycxSxxAndDcResBody);

        openResp.setName("jhSyYhLhjycxSxxAndDcResBody");
        openResp.setCnName("灵活就业缴费基数上下限及档次信息查询响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }

    /**
     * @createUser daiyuan
     * @createTime 2019/2/27 10:12 AM
     * @describe 城乡居民缴费金额上下限及档次信息查询
     **/

    public static void cxzmJf() {

        JhSyYhCxjmSxxAndDcRqBody open = new JhSyYhCxjmSxxAndDcRqBody();
        JhSyYhcxjfTyReqHead head = new JhSyYhcxjfTyReqHead("20181226");
        JhSyYhCxjmSxxAndDcReqBody body = new JhSyYhCxjmSxxAndDcReqBody("111000000000", "10220", "2018");

        open.setHead(head);
        open.setBody(body);

        String content = XmlUtil.toXmlNoHead(open);
        TiripPackage tiripPackage = new TiripPackage();
        Identity identity = new Identity("SYYHF1", "");
        tiripPackage.setIdentity(identity);
        ContentControl contentControl = new ContentControl();
        contentControl.setCode(new Code());
        contentControl.setEncrypt(new Encrypt());
        contentControl.setZip(new Zip());

        List<ParamList> listparam = new ArrayList<>();
        ParamList a = new ParamList("YH_APP", "102");
        ParamList b = new ParamList("tran_time", "20181119182314");
        ParamList c = new ParamList("bwckh", "20181106000000000001");
        listparam.add(a);
        listparam.add(b);
        listparam.add(c);
        tiripPackage.setRouterSession(listparam);
        tiripPackage.setContentControl(contentControl);
        ReturnState returnState = new ReturnState("000", "成功");
        tiripPackage.setReturnState(returnState);
        SubPackage sub = new SubPackage(XmlUtil.addCdata(content));
        BusinessContent businessContent = new BusinessContent();
        businessContent.setSubPackage(sub);
        tiripPackage.setBusinessContent(businessContent);
        String str = XmlUtil.toXml(tiripPackage, "GBK");
        System.out.println(str);
        TiripPackage tri = XmlUtil.toBean(str, TiripPackage.class);
        System.out.println(XmlUtil.subCdata(tri));
        JhSyYhCxjmSxxAndDcRqBody open1 = XmlUtil.toBean(XmlUtil.subCdata(tri), JhSyYhCxjmSxxAndDcRqBody.class);
        System.out.println(open1);


        tiripPackage.getIdentity().setServiceId("SYYHF2");
        tiripPackage.setContentControl(new com.zj.common.req.ContentControl());
        tiripPackage.setReturnState(new ReturnState("C01", "查询成功"));
        List<CxjmcxSxxDcJfmxList> cxjmcxSxxDcJfmxList = new ArrayList<>();

        CxjmcxSxxDcJfmxList cxjmcxSxxDcJfmxList1 = new CxjmcxSxxDcJfmxList("110011001100", "10032", "100902000", "1003210900909099", "18", "65", "0", "100.0", "1000.0", "测试档次", "300.0", "20180101", "20181231");
        CxjmcxSxxDcJfmxList cxjmcxSxxDcJfmxList2 = new CxjmcxSxxDcJfmxList("110011001100", "10032", "100902000", "1003210900909099", "18", "65", "0", "100.0", "1000.0", "测试档次", "300.0", "20180101", "20181231");

        cxjmcxSxxDcJfmxList.add(cxjmcxSxxDcJfmxList1);
        cxjmcxSxxDcJfmxList.add(cxjmcxSxxDcJfmxList2);
        JhSyYhCxjmcxSxxAndDcResBody jhSyYhCxjmcxSxxAndDcResBody = new JhSyYhCxjmcxSxxAndDcResBody(new ReturnInfo("000", "成功"), cxjmcxSxxDcJfmxList);
        JhSyYhCxjmSxxAndDcRpBody openResp = new JhSyYhCxjmSxxAndDcRpBody(new JhSyPublicHead("102100000018", "20181226"), jhSyYhCxjmcxSxxAndDcResBody);

        openResp.setName("jhSyYhCxjmcxSxxAndDcResBody");
        openResp.setCnName("城乡居民缴费金额上下限及档次信息查询响应（对外）");
        tiripPackage.setBusinessContent(
                new BusinessContent(new SubPackage(XmlUtil.addCdata(XmlUtil.toXmlNoHead(openResp)))));
        System.out.println("测试输出" + XmlUtil.toXml(tiripPackage, "GBK"));
    }
}